<template>
    <div class="itemTab" @click="jumpPathTo(item['season_id'])">
        <div class="itemImg">
            <img :src="item.vertical_cover" alt="" />
            <span class="loading">图片加载中...</span>
        </div>
        <div class="itemTitle">{{ item.title }}</div>
        <div class="itemInfo">{{ { finish: item.is_finish, section: item.last_ord } | dispose }}</div>
    </div>
</template>

<script>
export default {
    name: "itemTab",
    props: ["item"],
    filters: {
        dispose(value) {
            if (value.finish == 0) {
                return "更新至" + value.section + "章";
            } else if (value.finish == 1) {
                return "[已完结] 共" + value.section + "章";
            }
        },
    },
    methods: {
        jumpPathTo(x) {
            this.$router.push({ path: `/details/${x}`, query: { id: x } });
        },
    },
};
</script>

<style lang="scss" scope>
@import url(../static/style/reset.css);
@import "../static/style/variable.scss";

.itemTab {
    height: 4.8rem;
    width: 2.62rem;
    padding: 8px;
    .itemImg {
        width: 2.62rem;
        height: 3.68rem;
        font-size: 13px;
        position: relative;
        .loading {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: whitesmoke;
            text-align: center;
            line-height: 3.68rem;
            z-index: -1;
        }
        img {
            width: 100%;
            height: 3.68rem;
        }
    }
    .itemTitle {
        height: 0.48rem;
        margin-top: 0.2133rem;
        font-size: 0.3733rem;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }
    .itemInfo {
        height: 0.4267rem;
        font-size: 0.32rem;
    }
}
</style>
